package ch.uzh.ifi.seal.ssqa.preferences;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import ch.uzh.ifi.seal.ssqa.SsqaPlugin;

public class ModelStoragePreferencePage
	extends FieldEditorPreferencePage
	implements IWorkbenchPreferencePage {

	public ModelStoragePreferencePage() {
		super(GRID);
		setPreferenceStore(SsqaPlugin.getDefault().getPreferenceStore());
		setDescription("Here you can define the Storage Preferences");
	}
	
	/**
	 * Creates the field editors. Field editors are abstractions of
	 * the common GUI blocks needed to manipulate various types
	 * of preferences. Each field editor knows how to save and
	 * restore itself.
	 */
	public void createFieldEditors() {
		addField(new StringFieldEditor(PreferenceConstants.STORAGE_NAMESPACE, "&Namespace:", 60, getFieldEditorParent()));
		
		addField(new StringFieldEditor(PreferenceConstants.STORAGE_URI, "&URL:",60, getFieldEditorParent()));
		
		addField(new StringFieldEditor(PreferenceConstants.STORAGE_DB, "&Database:", 30, getFieldEditorParent()));
		
		addField(new StringFieldEditor(PreferenceConstants.STORAGE_DRIVER, "&JDBC Driver:",60, getFieldEditorParent()));
		
		addField(new StringFieldEditor(PreferenceConstants.STORAGE_USER, "&Username:", 60, getFieldEditorParent()));
		
		addField(new StringFieldEditor(PreferenceConstants.STORAGE_PW, "&Password:", 60, getFieldEditorParent()));
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
	 */
	public void init(IWorkbench workbench) {
	}
	
}